<include file="public@head"/>
<style>
    .sq-form{border-radius:5px;background-color: #fff;padding:30px;box-shadow: 3px 3px 3px #ececec;border: 1px solid #ececec;}
    .sq-form-item{display: flex;align-items: center;margin-bottom: 20px;}
    .sq-form-item .item-label{width: 130px;color: #999}
    .sq-form-item .item-input{width: 300px;height: 38px;line-height: 38px;}
</style>
<body>
    <div class="templatemo-content">'
        <!--  我的应用左侧 -->
        <include file="public@tube"/>
        <!--  我的应用左侧 -->

        <!--  修改资料-->
        <div class="templatemo-body">
            <h5>修改密码</h5>

            <div class="sq-form">
                <form class="layui-form" action="">
                    <div class="sq-form-item">
                        <div class="item-label">原始密码：</div>
                        <div class="item-input">
                            <input name="old_password" required type="password" placeholder="请输入旧密码" class="layui-input">
                        </div>
                    </div>

                    <div class="sq-form-item">
                        <div class="item-label">新密码：</div>
                        <div class="item-input">
                            <input name="password" required type="password" placeholder="请输入新密码" class="layui-input">
                        </div>
                    </div>

                    <div class="sq-form-item">
                        <div class="item-label">重复密码：</div>
                        <div class="item-input">
                            <input name="repassword" required type="password" placeholder="请输入确认密码" class="layui-input">
                        </div>
                    </div>

                    <div class="sq-form-item">
                        <div class="item-label"></div>
                        <button class="layui-btn layui-btn-normal" lay-submit lay-filter="form_password">保存</button>
                    </div>
                </form>
            </div>
        </div>
        <!--  修改资料-->
    </div>
</body>
<include file="public@footer"/>
<script>
$(function () {
    layui.use(['form','layer','element'], function () {
        var form = layui.form,
            layer = layui.layer,
            element = layui.element;

        //修改提交
        form.on('submit(form_password)',function(data){
            data = data.field;
            $.post("{:url('user/Profile/passwordPost')}",data,function(res){
                if(res.code==200){
                    layer.msg('修改成功',{icon:6});
                }else{
                    layer.msg(res.message,{icon:5});
                }
            });
            return false;
        });
        form.render()
    })
})
</script>
